alter table jms_dm.dm_cusc_customer_abnormal_waybill_detail_dt
    set tblproperties ('external.table.purge' = 'true');
drop table jms_dm.dm_cusc_customer_abnormal_waybill_detail_dt;
 create external table jms_dm.dm_cusc_customer_abnormal_waybill_detail_dt
(
    waybill_no                  string comment '运单',
    deliver_aging_sign_difftime string comment '派签时间差',
    proble_type_subject_code    array<string> comment '一级类型code41遗失 27破损 35被污染 999其他',
    proble_type_subject_name    string comment '一级类型name',
    no_taketimely_flag          int comment '1未及时揽收',
    no_collect_flag             int comment '1不准点交件票',
    false_taking_flag           int comment '1虚假揽收',
    no_outtimely_flag           int comment '1出港不及时',
    no_signtimely_flag          int comment '1未及时签收',
    complaint_flag              int comment '1客诉量',
    sign_difftime_flag          int comment '1网点出仓',
    problem_flag                int comment '1问题件',
    order_id                    string comment '订单号',
    customer_id                 string comment '客户id',
    customer_code               string comment '客户编码',
    customer_name               string comment '客户名称',
    customer_network_code       string comment '客户所属网点code',
    customer_network_name       string comment '客户所属网点name',
    order_source_code           string comment '订单来源code',
    order_source_name           string comment '订单来源名称',
    input_time                  string comment '订单录入时间',
    way_input_time              string comment '运单录入时间',
    deliver_early_scantime      string comment '宽表第一次派件时间',
    sign_early_scantime         string comment '宽表第一次签收时间',
    taking_early_scansitecode   string comment '宽表最早揽收网点',
    taking_early_scansitename   string comment '宽表最早揽收网点name',
    sign_code                   string comment '宽表第一次签收网点',
    sign_name                   string comment '宽表第一次签收网点name',
    customer_fran_code          string comment '客户所属加盟商code',
    customer_fran_name          string comment '客户所属加盟商name',
    customer_agent_code         string comment '客户所属代理区code',
    customer_agent_name         string comment '客户所属代理区name',
    start_fran_code             string comment '始发网点加盟商code',
    start_fran_name             string comment '始发网点加盟商name',
    start_agent_code            string comment '始发网点代理区code',
    start_agent_name            string comment '始发网点代理区name',
    start_provider_id           string comment '始发网点省id',
    start_provider_desc         string comment '始发网点省name',
    start_city_id               string comment '始发网点市id',
    start_city_desc             string comment '始发网点市name',
    start_area_id               string comment '始发网点区id',
    start_area_desc             string comment '始发网点区name',
    end_fran_code               string comment '目的网点加盟商code',
    end_fran_name               string comment '目的网点加盟商name',
    end_agent_code              string comment '目的网点代理区code',
    end_agent_name              string comment '目的网点代理区name',
    end_virt_code               string comment '目的网点代理区name',
    end_virt_name               string comment '目的网点代理区name',
    end_provider_id             string comment '目的网点省id',
    end_provider_desc           string comment '目的网点省name',
    end_city_id                 string comment '目的网点市id',
    end_city_desc               string comment '目的网点市name',
    end_area_id                 string comment '目的网点区id',
    end_area_desc               string comment '目的网点区name',
    date_time                   string comment '日期'
) comment '智兔app-客户异动运单明细'
    partitioned by (dt string comment '分区日期')
    stored as parquet
    location '/dw/hive/jms_dm.db/external/dm_cusc_customer_abnormal_waybill_detail_dt'



